import { createRouter, createWebHistory } from 'vue-router'
import AppLayout from '../components/layout/AppLayout.vue'
import IndexView from '../views/indexView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Applayout',
      component: AppLayout,
      children: [{
        path: '',
        name: 'IndexView',
        component: IndexView
      },
      {
        path: '/menus',
        name: 'menus',
        component: () => import('../views/menu/MenuIndex.vue')
      },{
        path: '/menus/create',
        name: 'menus-create',
        component: () => import('../views/menu/CreateOrEdit.vue')
      },
      {
        path: '/menus/:id/edit',
        name: 'menus-edit',
        component: () => import('../views/menu/CreateOrEdit.vue')
      },
      {
        path: '/resources',
        name: 'resources',
        component: () => import('../views/resources/ResourceManagement.vue')
      },
      
      {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (About.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import('../views/AboutView.vue')
      },
      {
        path: '/:xxx(.*)*',
        name: 'NotFound',
        component: () => import('../views/NotFound.vue')
      }
      ]
    }, {
      path: '/login',
      name: 'login',
      component: () => import('../views/IndexLogin.vue')
    }
    , {
      path: '/excel',
      name: 'login',
      component: () => import('../views/AboutView.vue')
    }
  ]
})

export default router
